Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling build id in view page #651

Merged
merged 8 commits into from
Sep 19, 2024
Merged

Conversation

pditommaso
Copy link
Contributor

This PR allows the accessing the build page given the container id. For example having the container HOST/wt/d67234213cdb/wave/build/dev:a97082cddd28bacf, the id a97082cddd28bacf can be used to access the URI https://HOST/view/builds/a97082cddd28bacf_1

@pditommaso
Copy link
Contributor Author

@munishchouhan I need some help with this Surreal query

final query = "select * from wave_build where buildId ~ '${containerId}${BuildRequest.SEP}' order by startTime desc limit 1"

I'd like to have the equivalent of buildId like '${something}_%' in SQL, but not sure there's a like` operator in Surreal

@munishchouhan
Copy link
Member

@munishchouhan I need some help with this Surreal query

I will check it out

@munishchouhan
Copy link
Member

we can use string::contains(string, string) -> bool
like:
seqera/wave> select * from wave_build where string::contains( buildId,'b6266b6b8aead019_')

[[{ buildId: 'b6266b6b8aead019_1', condaFile: 'channels:
- conda-forge
- bioconda
dependencies:
- bwa
', digest: sha256:ab5e16ac0f300c1054bb9ee382b866314680fe118465b956624121fb264e75a5, dockerFile: 'FROM mambaorg/micromamba:1.5.8-lunar
COPY --chown=$MAMBA_USER:$MAMBA_USER conda.yml /tmp/conda.yml
RUN micromamba install -y -n base -f /tmp/conda.yml \\
    && micromamba install -y -n base conda-forge::procps-ng \\
    && micromamba clean -a -y
USER root
ENV PATH="$MAMBA_ROOT_PREFIX/bin:$PATH"
', duration: 59.042196f, exitStatus: 0, format: 'DOCKER', id: wave_build:d9ec62mqy0nimjjgy6i1, offsetId: '+02:00', platform: 'linux/arm64', requestIp: '127.0.0.1', scanId: '61bec051aded', startTime: '2024-09-18T11:04:05.827099Z', targetImage: 'docker.io/hrma017/dev:bwa--b6266b6b8aead019' }]]

@munishchouhan
Copy link
Member

…lPersistenceService.groovy

Co-authored-by: Munish Chouhan <[email protected]>
@pditommaso
Copy link
Contributor Author

@munishchouhan not sure string::contains is working as expected

@munishchouhan
Copy link
Member

@munishchouhan not sure string::contains is working as expected

ok i will check again

@munishchouhan
Copy link
Member

can you please share the issue, you are facing?

I tried it with multiple records and different strings

seqera/wave> select buildId from wave_build where string::contains(buildId, '3b62973cb1c32131')
[[{ buildId: '3b62973cb1c32131_1' }]]

seqera/wave> select buildId from wave_build where string::contains(buildId, '3b62973cb1c32131#')
[[]]

seqera/wave> select buildId from wave_build where string::contains(buildId, '3b62973cb1c32131_')
[[{ buildId: '3b62973cb1c32131_1' }]]

seqera/wave> select buildId from wave_build where string::contains(buildId, 'b62973cb1c32131_')
[[{ buildId: '3b62973cb1c32131_1' }]]

seqera/wave> select buildId from wave_build where string::contains(buildId, 'b62973cb1c32')
[[{ buildId: '3b62973cb1c32131_1' }]]

seqera/wave> select buildId from wave_build where string::contains(buildId, '3')
[[{ buildId: '77da871a4206bee3_1' }, { buildId: '3b62973cb1c32131_1' }]]

@pditommaso
Copy link
Contributor Author

I've assumed that's the query because the build failed, not 100% sure tho

@munishchouhan
Copy link
Member

I tested a build locally using this PR and it was successful

Screenshot 2024-09-18 at 18 27 17

@pditommaso
Copy link
Contributor Author

Yeah, but the build is failing 😆

@munishchouhan
Copy link
Member

Yeah, but the build is failing 😆

ok you mean gradle build

@pditommaso

This comment was marked as off-topic.

@munishchouhan

This comment was marked as outdated.

Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
@pditommaso pditommaso merged commit 69f82dc into master Sep 19, 2024
4 checks passed
@pditommaso pditommaso deleted the improve-build-controller branch September 19, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants